import java.util.*;

public abstract class _Banque {

	public static boolean validiteDate(String date) {

		if (date == null)
			return false;

		int m = mois(date);
		int j = jour(date);
		int a = annee(date);

		if (a > (annee(dateCourante()) + 1) || a < 1900) {
			return false;
		}
		if ((a == annee(dateCourante())) && m > mois(dateCourante()) || m>12 || m<1) {
			return false;
		}
		if (a == annee(dateCourante()) && m>mois(dateCourante()) && j>jour(dateCourante()) || j>31 || j<1) {
			return false;
		}
		StringTokenizer st = new StringTokenizer(date, "/");
		st.nextToken();
		String s = st.nextToken().toString();
		if (s.length()!=2) {
			return false;
		}
		String s2 = st.nextToken().toString();
		if (s2.length()!=2) {
			return false;
		}
		if ((m<=7 && m%2==0) || (m>7 && m%2==1)) {
			if (j>30)
				return false;
		}
		if (m==2 && isBissextile(annee(date)) && j>29)
			return false;
		if (m==2 && !isBissextile(annee(date)) && j>28)
			return false;
		return true;
	}

	public static boolean isBissextile(int annee) {
		return (annee%4==0 && (annee%100!=0 || annee%400==0));
	}

	public static  int   annee(String date) {
		StringTokenizer st = new StringTokenizer(date, "/");
		String s = st.nextToken().toString();
		int an = 0;
		try {
			an = Integer.parseInt(s);
		}catch (NumberFormatException e) {
			return 0;
		}

		return an;
	}

	public static  int   mois(String date) {
		StringTokenizer st = new StringTokenizer(date, "/");
		st.nextToken();
		String s = st.nextToken().toString();
		int m = 0;
		try {
			m = Integer.parseInt(s);
		}catch (NumberFormatException e) {
			return 0;
		}
		return m;
	}

	public static int jour(String date) {
		StringTokenizer st = new StringTokenizer(date, "/");
		st.nextToken();
		st.nextToken();
		String s = st.nextToken().toString();
		int j = 0;
		try {
			j = Integer.parseInt(s);
		}catch (NumberFormatException e) {
			return 0;
		}
		return j;
	}

	public static String dateCourante() {

		GregorianCalendar now = new GregorianCalendar();
		int annee = now.get(Calendar.YEAR);
		int mois = now.get(Calendar.MONTH) + 1;
		int jour = now.get(Calendar.DAY_OF_MONTH);
		String m, j;

		if (mois<=9) m = "0" + mois;
		else m = "" + mois;

		if (jour<=9) j = "0" + jour;
		else j = "" + jour;

		return (annee + "/" + m + "/" + j);
	}
}